package com.hqyj.controller;


import com.hqyj.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@Controller
@RequestMapping("/permission")
public class permissionController {
    @Autowired
    PermissionService permissionService;

    //跳转到展示页面
    @RequestMapping("/ListPage")
    public String listPage() {
        return "permissionList";
    }
//跳转到添加权限的页面
    @RequestMapping("/addPermission")
    public String addPermission() {
        return "permissionAdd";
    }

    //页面修改权限
    @RequestMapping("/permissionEdit")
    public String permissionEdit() {
        return "permissionEdit";
    }


    @RequestMapping("/permissionList")
    @ResponseBody
    public HashMap<String, Object> permissionsList() {
        HashMap<String, Object> map = permissionService.permissionList();
        return map;
    }
}
